<style type="text/css">
.menu_list {
	width: 150px;
}
.menu_head {
	padding: 5px 10px;
	cursor: pointer;
	position: relative;
	margin:1px;
       font-weight:bold;
       background: #eef4d3 url(left.png) center right no-repeat;
}
.menu_body {
	display:none;
}
.menu_body a {
  display:block;
  color:#006699;
  background-color:#EFEFEF;
  padding-left:10px;
  font-weight:bold;
  text-decoration:none;
}
.menu_body a:hover {
  color: #000000;
  text-decoration:underline;
}
</style>

<?php 

//require_once plugins_url() . "/disaster_plugin/db.php";

get_header(); 

$list = db_event_list(0);
?>
		<?php if (have_posts()) : ?>
		<div id="main-top">
			<div class="main-top-left">
			    <h4>Browse Disaster Events</h4>
			</div>
			<?php if (is_file(STYLESHEETPATH . '/subscribe.php' )) include(STYLESHEETPATH . '/subscribe.php' ); else include(TEMPLATEPATH . '/subscribe.php' ); ?>
		</div>
		<div id="main" class="clear">
			<div id="content">
				<?php while (have_posts()) : the_post(); ?>
					<h1 class="title"><?php the_title(); ?></h1>
					<div class="entry page">
						<?php if ( function_exists( 'add_theme_support' ) ) the_post_thumbnail( 'index-thumb', array( 'class' => 'single-post-thm alignright border' ) ); ?>

							
							
	<script type="text/javascript">	
     var $j = jQuery.noConflict();
	$j(function() 
	{ 
		$j("#disaster-accordion").accordion();
		
	} );
	 $j("#firstpane p.menu_head").click(function()
	{
	
    $j(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
    $j(this).siblings().css({backgroundImage:"url(left.png)"});
	});
	</script>


<div id="disaster-accordion">

	
<?php	
		foreach($list as $event)
		{
      	
		   $titles = $event["name"];
		   $place = $event["location"];
		   $summary = $event["description"];
		   $date = $event["start_date"];
		   
?>
		    <h3><a href="#"> <?=$titles?> - <?=$place?> </a></h3>
			<div>
			    <p><b> Date: </b> <?=$date?> </p>
			    <p><b> Location: </b> <?=$place?> </p>
			    <p><b> Description: </b></p>
			    <p> <?=$summary?> </p>
			    <p>
				<a class="event-link" href="<?=get_event_url($event['event_id'])?>">View Disaster Event Summary Page</a>
			    </p>
			</div>
	
<?		
        }

?>
		
</div>


							</script>
						
						<?php edit_post_link(__( 'Edit', 'traction' )); ?>
					</div><!--end entry-->
			<?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
			<?php else : ?>
			<?php endif; ?>
			</div><!--end content-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>